package org.dc.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import org.dc.R;
import org.dc.activity.schedule.Schedule;
import org.dc.activity.workDay.OneDayScr;
import org.dc.activity.workDay.WorkDayScr;
import org.dc.service.PersistenceManager;

public class MainFrame extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_frame);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);
        return true;
    }

    public void openShifts(View v) {
        Intent i = new Intent(this, ShiftsScr.class);
        startActivity(i);
    }

    public void openSchedule(View v) {
        Intent i = new Intent(this, Schedule.class);
        startActivity(i);
    }
    
    public void openWorkDay(View v) {
        Intent i = new Intent(this, WorkDayScr.class);
        startActivity(i);
    }

    public void openSettings(View v) {
        Intent i = new Intent(this, Settings.class);
        startActivity(i);
    }

    public void openOneDay(View v){
        Intent i = new Intent(this, OneDayScr.class);
        startActivity(i);
    }
    
    public void exit(View v){
        PersistenceManager.close();
        finish();
    }
    
}
